@extends('company.company')

@section('title','企业中心')
@section('rightcontainer')
@include('front.common.editor')
<link href="{{asset('/css/star-rating.css')}}" media="all" rel="stylesheet" type="text/css"/>
<script src="{{asset('/js/star-rating.js')}}" type="text/javascript"></script>
<div class="col-xs-10" style="padding-right: 0;">
    <div class="filter bord-1 backgr-color-white">
        <ul>
            <li class="padd-15-15-0-15">
                <span class="padd-r-30">职位名称：</span>
                <dl>
                    <dt class="@if(empty($nowjob)) active @endif"><a href="{{url('/company/center/resume-'.$type.'?job=&degree='.$dg.'&nx='.$nx.'&rst='.$rst.'&tm='.$tm)}}">全部</a></dt>
                    @foreach($jobs as $cjob)
                    <dt class="@if($cjob->jobs_id == $nowjob) active @endif"><a href="{{url('/company/center/resume-'.$type.'?job='.$cjob->jobs_id.'&degree=&nx='.$nx.'&rst='.$rst.'&tm='.$tm)}}">{{$cjob->title}}</a></dt>
                    @endforeach
                </dl>
            </li>
            <li class="padd-0-15 bodertop">
                <span class="padd-r-30">学历：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                <dl>
                    <dt class="@if($dg == 100) active @endif"><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree=100&nx='.$nx.'&rst='.$rst.'&tm='.$tm)}}">全部</a></dt>
                    @foreach ($degree as $ke => $de)
                        <dt class="@if($dg == $ke) active @endif"><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$ke.'&nx='.$nx.'&rst='.$rst.'&tm='.$tm)}}">{{ $de }}</a></dt>
                    @endforeach
                </dl>
            </li>
            <li class="padd-0-15 bodertop">
                <span class="padd-r-30">经验：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                <dl>
                    <dt class="@if($nx == 100) active @endif"><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$dg.'&nx=100&rst='.$rst.'&tm='.$tm)}}">全部</a></dt>
                    @foreach($gznx as $key=>$gnx)
                    <dt class="@if($nx == $key) active @endif"><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$dg.'&nx='.$key.'&rst='.$rst.'&tm='.$tm)}}">{{$gnx}}</a></dt>
                    @endforeach
                </dl>
            </li>
            <li class="padd-0-15 bodertop">
                <span class="padd-r-30">求职状态：</span>
                <dl>
                    <dt class="@if(empty($rst)) active @endif"><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$dg.'&nx='.$nx.'&rst=&tm='.$tm)}}">全部</a></dt>
                    @foreach($resumeStatus as $rs)
                    <dt class="@if($rst == $rs['id']) active @endif"><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$dg.'&nx='.$nx.'&rst='.$rs['id'].'&tm='.$tm)}}">{{$rs['name']}}</a></dt>
                    @endforeach
                </dl>
            </li>
            <li class="padd-0-15 bodertop">
                <span class="padd-r-30">投递时间：</span>
                <dl>
                    <dt class="active"><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$dg.'&nx='.$nx.'&rst='.$rst.'&tm=')}}">全部</a></dt>
                    <dt><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$dg.'&nx='.$nx.'&rst='.$rst.'&tm=1')}}">一天内</a></dt>
                    <dt><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$dg.'&nx='.$nx.'&rst='.$rst.'&tm=2')}}">一周内</a></dt>
                    <dt><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$dg.'&nx='.$nx.'&rst='.$rst.'&tm=3')}}">一个月内</a></dt>
                    <dt><a href="{{url('/company/center/resume-'.$type.'?job='.$nowjob.'&degree='.$dg.'&nx='.$nx.'&rst='.$rst.'&tm=4')}}">一个月以上</a></dt>
                </dl>
            </li>
        </ul>
    </div>
    <div class="clr"></div>
    <div class="tab-row-1 font-16 bord-1 margin-t-15">
        <ul>
            <li><strong>操作</strong></li>
            <li><strong>姓名</strong></li>
            <li><strong>职位名称</strong></li>
            <li><strong>基本信息</strong></li>
            <li><strong>经验</strong></li>
            <li><strong>学历</strong></li>
            <li><strong>求职状态</strong></li>
            <li><strong>投递时间</strong></li>
            <li><strong>信用评价</strong></li>
        </ul>
    </div>
    @foreach($resumes as $resume)
    <div class="tab-row-1 bord-l-r" id="resume_{{$resume->id}}">
        <ul>
            <li class="cursor-pointer dropdown">
                @if($resume->hasComment == 1)
                 <span id="dropdownMenu1" class="color-1 font-14 height-auto cursor-pointer">企业已评</span>
                @else
                    @if($resume->status == 0)
                    <span id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                        <span class="glyphicon glyphicon-plus color-8 font-18 height-auto cursor-pointer"></span>
                    </span>
                    @elseif($resume->status == 1)
                     <span id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                        <span class="glyphicon glyphicon-remove-sign color-13 font-18 height-auto"></span>
                        <span class="padd-l-5">...</span>
                    </span>
                    @elseif($resume->status == 2)
                    <span id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                        <span class="glyphicon glyphicon-ok-sign color-1 font-18 height-auto" ></span>
                        <span class="padd-l-5">...</span>
                    </span>
                    @elseif($resume->status == 3)
                    <span id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                        <span class="glyphicon glyphicon-envelope color-7 font-18 height-auto"></span>
                        <span class="padd-l-5">...</span>
                    </span>
                    @endif
                    <dl class="dropdown-menu change-resume-status" aria-labelledby="dropdownMenu1">
                        @if($resume->status == 2)
                        <dt class=" line-height-45">
                            <a href="#" onclick="changeResumeStatus(this,'{{url('/company/center/resume/status/'.$resume->id)}}','{{csrf_token()}}',1)">
                                <span class="glyphicon glyphicon-remove-sign color-13 font-18"></span>
                                不符合要求
                            </a>
                        </dt>
                        <dt class=" line-height-45">
                            <a href="j#" onclick="changeResumeStatus(this,'{{url('/company/center/resume/status/'.$resume->id)}}','{{csrf_token()}}',3)">
                                <span class="glyphicon glyphicon-envelope color-7 font-18"></span>
                                已发Offer
                            </a>
                        </dt>
                        <dt class=" line-height-45">
                            <a href="#" data-toggle="modal" data-target="#tocomment_{{$resume->id}}">
                                <span class="glyphicon glyphicon-comment color-7 font-18"></span>
                                信用评分
                            </a>
                        </dt>
                        @elseif($resume->status == 3 || $resume->status == 1)
                        <dt class=" line-height-45">
                            <a href="#" data-toggle="modal" data-target="#tocomment_{{$resume->id}}">
                                <span class="glyphicon glyphicon-comment color-7 font-18"></span>
                                信用评分
                            </a>
                        </dt>
                        @else
                        <dt class="line-height-45">
                            <a href="javascript:void(0);" onclick="changeResumeStatus(this,'{{url('/company/center/resume/status/'.$resume->id)}}','{{csrf_token()}}',1)">
                                <span class="glyphicon glyphicon-remove-sign color-13 font-18"></span>
                                不符合要求
                            </a>
                        </dt>
                        <dt class=" line-height-45">
                            <a href="javascript:void(0);" onclick="changeResumeStatus(this,'{{url('/company/center/resume/status/'.$resume->id)}}','{{csrf_token()}}',2)">
                                <span class="glyphicon glyphicon-ok-sign color-1 font-18"></span>
                                通知面试
                            </a>
                        </dt>
                        <dt class=" line-height-45">
                            <a href="javascript:void(0);" onclick="changeResumeStatus(this,'{{url('/company/center/resume/status/'.$resume->id)}}','{{csrf_token()}}',3)">
                                <span class="glyphicon glyphicon-envelope color-7 font-18"></span>
                                已发Offer
                            </a>
                        </dt>
                        @endif
                      </dl>
                  @endif
            </li>
            <li><a href="javascript:void(0)" class="color-1" onclick="viewResume('/company/center/resumeview/{{$resume->id}}')">{{$resume->resume->real_name}}</a></li>
            <li>{{str_limit($resume->jobs->title,10)}}</li>
            <li>
                {{$resume->resume->sex == 1 ? '男':'女'}} / {{user_age($resume->resume->birth_year,$resume->resume->birth_month)}}
            </li>
            <li>
                <span>{{$gznx[$resume->gznx]}}</span>
            </li>
            {{--<li>
                <span>{{$degree[$resume->resume->degree]}}</span>
            </li>--}}
            <li>
                <span>{{$resume->edu[0]['school']}}</span>
            </li>
            <li>
                <span style="overflow: hidden">@if($resume->resume_status == 0) 在职 @else {{ str_limit($resume->rstatus->name,12) }} @endif</span>
            </li>
            <li>
                <span>{{date('Y-m-d',strtotime($resume->created_at))}}</span>
            </li>
            <li><a href="#" data-toggle="modal" data-target="#comment_list_{{$resume->id}}">查看评价</a></li>
        </ul>
    </div>
    <div class="modal fade bs-example-modal-lg" id="comment_list_{{$resume->id}}" tabindex="-1" role="dialog" aria-labelledby="commentListLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="commentListLabel">投递者【{{$resume->resume->real_name}}】信用评分</h4>
              </div>
              <div class="modal-body">
                    <div style="border-bottom:1px #f6f6f6 solid">
                        <div class="form-group clearfix">
                            <div class="col-xs-12 col-sm-3 col-3 ft-16 cor-2" style="height:55px;line-height:55px;">面试信用：</div>
                            <div class="col-sm-9 col-xs-12">
                                <input value="{{(empty($resume->userlevel->interview_level) || $resume->userlevel->interview_level <= 0)?5:$resume->userlevel->interview_level}}" readonly type="number" class="rating"  min=0 max=5 step=0.2 >
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <div class="col-xs-12 col-sm-3 col-3 ft-16 cor-2" style="height:55px;line-height:55px;">考试信用：</div>
                            <div class="col-sm-9 col-xs-12">
                                <input value="{{(empty($resume->userlevel->exam_level) || $resume->userlevel->exam_level <= 0)?5:$resume->userlevel->exam_level}}" readonly type="number" class="rating"  min=0 max=5 step=0.2 >
                            </div>
                        </div>
                    </div>
                    <div>
                        @foreach($resume->comments as $key=>$colist)
                        <div class="mt-20">
                            <p class="ft-14">{{$key+1}}、来自“{{$colist->company->name}}”的评价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{date('Y-m-d H:i',strtotime($colist->created_at))}}</p>
                            <div class="clearfix small-xwei-rating" style="padding-left: 20px;">
                                <div class="float-l ft-14 cor-2" style="width:80px;" >面试信用：</div>
                                <div class="float-l" style="width: 120px;"><input value="{{$colist->level}}" readonly type="number" class="rating"  min=0 max=5 step=0.2 data-size="sm"></div>
                                <div class="float-l ft-14 cor-2" style="width:80px;" >考试信用：</div>
                                <div class="float-l" style="width: 120px;"><input value="{{$colist->exam_level}}" readonly type="number" class="rating"  min=0 max=5 step=0.2 data-size="sm"></div>
                            </div>
                            <p class="ft-14" style="padding-left: 20px;">{{$colist->content}}</p>
                        </div>
                        @endforeach
                    </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
              </div>
            </div>
        </div>
    </div>
    <div class="modal fade bs-example-modal-lg" id="tocomment_{{$resume->id}}" tabindex="-1" role="dialog" aria-labelledby="tocommentLabel">
     <div class="modal-dialog" role="document">
        <form id="commentForm_{{$resume->id}}">
            <input type="hidden" name="user_id" value="{{$resume->user_id}}">
            <input type="hidden" name="resume_id" value="{{$resume->id}}">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="tocommentLabel">对投递者【{{$resume->resume->real_name}}】进行评论</h4>
              </div>
              <div class="modal-body">
                 <div class="form-group clearfix">
                    <div class="col-xs-12 col-sm-3 col-3 ft-16 cor-2" style="height:55px;line-height:55px;">面试信用：</div>
                    <div class="col-sm-9 col-xs-12">
                        <input id="input-level" name="level" type="number" class="rating" min=0 max=5 step=0.2 >
                    </div>
                  </div>
                  <div class="form-group clearfix">
                    <div class="col-xs-12 col-sm-3 col-3 ft-16 cor-2" style="height:55px;line-height:55px;">考试信用：</div>
                    <div class="col-sm-9 col-xs-12">
                        <input id="input-21b" name="exam_level" type="number" class="rating"  min=0 max=5 step=0.2 >
                    </div>
                  </div>
                  <div class="form-group clearfix">
                    <div class="col-xs-12 col-sm-3 col-3 ft-16 cor-2">评论内容：</div>
                    <div class="col-sm-9 col-xs-12">
                        <textarea class="form-control content" name="content" row="5"></textarea>
                    </div>
                  </div>
              </div>
              <div class="modal-footer">
                {!! csrf_field() !!}
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-action" onclick="resumeComment('/company/center/resume/comment','tocomment_{{$resume->id}}','commentForm_{{$resume->id}}','resume_{{$resume->id}}')">提交评论</button>
              </div>
            </div>
        </form>
      </div>
    </div>
    @endforeach
    <div>{!! $resumes->render() !!} </div>
</div>
<!-- <link href="{{ asset('/css/resume.css') }}" rel="stylesheet"> -->
<div class="modal fade bs-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document" style="width:1000px">
        <div class="modal-content" style="font-size: 12px;font-family: inherit;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel" style="text-align: center;">某某简历</h4>
            </div>
            <div class="modal-body">
                <div id="resume_container">
                    
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default float-l" id="notify" data-dismiss="modal">
                    <span class="glyphicon glyphicon-ok-sign color-1 font-18"></span>
                    通知面试
                </button>
                <button type="button" class="btn btn-default float-l" id="passed" data-dismiss="modal">
                    <span class="glyphicon glyphicon-envelope color-7 font-18"></span>
                    已发Offer
                </button>
                <button type="button" class="btn btn-default float-l" id="nopassed" data-dismiss="modal">
                    <span class="glyphicon glyphicon-remove-sign color-13 font-18"></span>
                    不符合要求
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-action" id="downloadResume">下载简历</button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
<!--

$('input').iCheck({
	checkboxClass: 'icheckbox_flat-blue',
    radioClass: 'iradio_flat-blue',
    increaseArea: '-10' // optional
});
var editor;
KindEditor.ready(function(K) {
	editor = K.create('.content', {	
    	resizeType : 1,
    	//allowPreviewEmoticons : false,
    	afterBlur: function () { this.sync(); },
    	allowImageUpload : true,
    	width : "100%", 
    	allowUpload : true,
    	//postParams:123,
    	//uploadJson : '/index.php?g=User&m=Upyun&a=kindedtiropic',
    	items : ["justifyleft", "justifycenter", "justifyright", ]
	});

});
//-->
</script>
@stop

<!--底部导航-->
@section('footer')
@parent
@stop

